#include <iostream>
#include <cstring>
using namespace std;

class MyArray{
	int* pBuff;
	int len;
public:
	MyArray(int* p, int n){
		len = n;
		pBuff = new int[n];
		memcpy(pBuff, p, sizeof(int)*n);
	}
	
	int operator[](int idx){
		return pBuff[idx];
	}
	/*friend int operator[](MyArray& a, int idx);*/
};

int main(){
	int arr[5] = { 1, 2, 3, 4, 5 };
	MyArray a(arr, 5);

	cout << a[3] << endl;


	while (1);
	return 0;
}